<template>
  <div class="count">
    <h2>我是count组件</h2>
    <p>count的值是{{ count }}</p>
    <button @click="addCount()">累加</button>
  </div>
</template>

<script>
export default {
  props: ["count", "addCount"],
  beforeCreate() {
    console.log("子组件------beforeCreate");
  },
  created() {
    console.log("子组件------created");
  },
  beforeMount() {
    console.log("子组件------beforeMount");
  },
  mounted() {
    console.log("子组件------mounted");
  },

  beforeUpdate() {
    console.log("子组件------beforeUpdate");
  },
  updated() {
    console.log("子组件------updated");
  },
  beforeDestroy() {
    console.log("子组件------beforeDestroy");
  },
  destroyed() {
    console.log("子组件------destroyed");
  },
};
</script>

<style scoped>
.count {
  background-color: pink;
}
</style>